//    entity language compiler Copyright (C) 2011 Vincent Belliard

//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation version 3 of the License.

//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.

//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "types.h"
#include "entity.h"

int main(int argc, char **argv)
{
if ((argc == 2) && (strcmp(argv[1], "-?") == 0))
	{
	fprintf(stderr, "entity compiler version 0.0\n") ;
	exit(0) ;
	}
if ((argc == 3) && (strcmp(argv[1], "-c") == 0))
	{
	T_string file_name(argv[2]) ;
	T_entity_compiler compiler ;
	compiler.add_file(file_name) ;
	compiler.compile_source_files() ;
	if (compiler.errors_count > 0) exit(2) ;
	}
else
	{
	fprintf(stderr, "entity compiler version 0.0\n") ;
	fprintf(stderr, "bad arguments\n") ;
	exit(1) ;
	}
return 0 ;
}
